package com.llm.travel_agent_assistant.controller;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("/api/hello")
public class HelloController {

    private final ChatClient chatClient;

    public HelloController(@Qualifier("deepSeekClient") ChatClient chatClient) {
        this.chatClient = chatClient;
    }

    @GetMapping("/test_stream")
    public Flux<String> hello(@RequestParam("msg") String msg) {
        return chatClient.prompt(msg).stream().content();
    }
}
